Illegal characters in path exception[closed]

Posted by Neir0 on Stack Overflow See other posts from Stack Overflow or by Neir0
Published on 2010-06-17T00:21:59Z Indexed on 2010/06/17 0:42 UTC
Read the original article Hit count: 312

Filed under:
|

Hi

I trying to get page from this url: YandexMarket

but WebClient and httpWebRequest throw exception

Illegal characters in path.

HttpUtility.UrlEncode doesnt work for this symbol "-".

Firefox and other browser are correctly open the page.

Here is my code:

public string GetPage(string url)
{
    var wReq = (HttpWebRequest)WebRequest.Create(url);
    return new StreamReader(wReq.GetResponse().GetResponseStream()).ReadToEnd();
}

How i can get the page?

Sorry guys. All ok.

© Stack Overflow or respective owner

Related posts about c#

Related posts about httpwebrequest